//  医院图标弹窗
function hospitalInfoContentcopy(baseinfo) {
  // console.log('baseinfo', baseinfo)
  for (let key in baseinfo) {
    // console.log(baseinfo[key])
    if (baseinfo[key] == null || baseinfo[key] == "") {
      baseinfo[key] = "暂无"
    }
  }
  return `
  <div style="margin:5px;width:95%;">
    <div style="display:flex;">
      <div style="font-weight:600;width:100px;text-align:left;">医院名称：</div>
      <span title="${baseinfo.chineseName}">${baseinfo.chineseName}</span>
    </div>
    <div style="display:flex;">
      <div style="font-weight:600;width:100px;text-align:left;">主管副院长：</div>
      <span>${baseinfo.contactName1}-${baseinfo.tel1}</span>
    </div>
    <div style="display:flex;">
      <div style="font-weight:600;width:100px;text-align:left;">联系人：</div>
      <span>${baseinfo.contactName2}-${baseinfo.tel2}</span>
    </div>
    <div style="display:flex;">
      <div style="font-weight:600;width:100px;text-align:left;">医院地址：</div>
      <span title="${baseinfo.chineseName}">${baseinfo.address}</span>
    </div>
  </div>
`
}
//  场馆图标弹窗
function venueContentcopy(baseinfo) {
  // console.log(baseinfo)
  for (let key in baseinfo.venueDetail[0]) {
    // console.log(baseinfo.venueDetail[0][key])
    if (baseinfo.venueDetail[0][key] == null || baseinfo.venueDetail[0][key] == "") {
      baseinfo.venueDetail[0][key] = "暂无"
    }
  }
  return `
    <div>
      <div style="height:30px;margin:0px;display:flex;justify-content:space-between;padding:10px;">
        <h3>${baseinfo.venueDetail[0].name}</h3>
      </div>
      <div style="display:flex;justify-content:space-between;padding:10px;">
        <div style="display:flex;justify-content:space-between;item-align:center;">
          <img id="imgDemo" src=${require("../../../assets/imgHome/dialogIcon/人员.png")} alt="图片"/>
          &nbsp;
          <div style="line-height:32px;">
          医疗点&nbsp;<b style="font-size:18px;">${baseinfo.venueDetail[0].medicalPointNumber}</b>个
          </div>
        </div>
        <div style="display:flex;justify-content:space-between;item-align:center;">
          <img id="imgDemo" src=${require("../../../assets/imgHome/dialogIcon/救护车.png")} alt="图片"/>
          &nbsp;
          <div style="line-height:32px;">
          救护车&nbsp;<b style="font-size:18px;">${baseinfo.venueDetail[0].ambulanceNumber}</b>辆
          </div>
        </div>
      </div>
      <div style="display:flex;justify-content:space-between;padding:15px;">
        <button id="medicalGroupClick" style="
        width:70px;
        height:20px;
        line-height:20px;
        border:1px solid #758bfd;
        color:#758bfd;
        background-color:#f5f6f7;
        cursor:pointer;">
        医疗点
        </button>
        <button id="ambulanceClick" style="
        width:70px;
        height:20px;
        line-height:20px;
        border:1px solid #758bfd;
        color:#758bfd;
        background-color:#f5f6f7;
        cursor:pointer;
        ">
        救护车
        </button>
        <button id="drugClick" style="
        width:70px;
        height:20px;
        line-height:20px;
        border:1px solid #758bfd;
        color:#758bfd;
        background-color:#f5f6f7;
        cursor:pointer;">
        药品耗材
        </button>
      </div>
  </div>
`
}
// 车辆信息弹窗
{/* <div style="display:flex;">
        <div style="font-weight:600;width:80px;text-align:left;">是否有效：</div>
        <span>${isEffective}</span>
      </div> */}
function vehicleInfoContentcopy(baseinfo) {
  // console.log(baseinfo)
  for (let key in baseinfo) {
    // console.log(baseinfo[key])
    if (baseinfo[key] == null || baseinfo[key] == "") {
      baseinfo[key] = "暂无"
    }
  }
  var isOnline = baseinfo.IsOnline == 1 ? "在线" : "离线"
  var isEffective = baseinfo.IsEffective == 1 ? "有效" : "无效"
  return `
    <div style="margin:5px;width:95%;">
      <div style="display:flex;">
        <div style="font-weight:600;width:80px;text-align:left;">车牌号：</div>
        <span>${baseinfo.Name}</span>
        <button id="vehicleMonitoringClick" style="
          width:70px;
          height:20px;
          line-height:20px;
          border:1px solid #758bfd;
          color:#758bfd;
          background-color:#f5f6f7;
          cursor:pointer;
          position: relative;left:60px;">
          车载监控
        </button>
      </div>
      <div style="display:flex;">
        <div style="font-weight:600;width:80px;text-align:left;">车辆状态：</div>
        <span>${baseinfo.StateName}</span></span>
      </div>
      <div style="display:flex;">
        <div style="font-weight:600;width:80px;text-align:left;">医生：</div>
        <span>${baseinfo.Doctor}</span>
      </div>
      <div style="display:flex;">
        <div style="font-weight:600;width:80px;text-align:left;">司机：</div>
        <span>${baseinfo.Driver}</span>
      </div>
      <div style="display:flex;">
        <div style="font-weight:600;width:80px;text-align:left;">护士：</div>
        <span>${baseinfo.Nurse}</span>
      </div>
      <div style="display:flex;">
        <div style="font-weight:600;width:80px;text-align:left;">是否在线：</div>
        <span>${isOnline}</span>
      </div>
    </div>
  `
}

// 非保障车辆信息弹窗
function vehicleInfoContentNotGuarantee(baseinfo) {
  // console.log(baseinfo)
  return `
    <div style="margin:5px;width:95%;">
      <div  style="display:flex;">
        <div style="font-weight:600;width:80px;text-align:left;">车牌号：</div>
        <span>${baseinfo.ambName}</span>
      </div>
      <div  style="display:flex;">
        <div style="font-weight:600;width:80px;text-align:left;">车辆状态：</div>
        <span>${baseinfo.ambStateName}</span>
      </div>
      <div  style="display:flex;">
        <div style="font-weight:600;width:80px;text-align:left;">医生：</div>
        <span>${baseinfo.ambDoctor}</span>
      </div>
      <div  style="display:flex;">
        <div style="font-weight:600;width:80px;text-align:left;">司机：</div>
        <span>${baseinfo.ambDriver}</span>
      </div>
      <div  style="display:flex;">
        <div style="font-weight:600;width:80px;text-align:left;">护士：</div>
        <span>${baseinfo.ambNurse}</span>
      </div>
    </div>
  `
}
//  医疗点图标弹窗
function venueMedicalPointContentcopy(baseinfo) {
  // console.log(baseinfo)
  for (let key in baseinfo) {
    // console.log(baseinfo[key])
    if (baseinfo[key] == null || baseinfo[key] == "") {
      baseinfo[key] = "暂无"
    }
  }
  var personDoctorTel = ""
  var personNurseTel = ""
  // 医生格式化
  if (baseinfo.Doctor && baseinfo.Doctor != "" && baseinfo.Doctor != null) {
    let a = baseinfo.Doctor.split(",")
    a.forEach(item => {
      // 不等于空格时
      if (item != " ") {
        personDoctorTel += item + (item != "" ? '<br />' : "")
      }

    })
  } else {
    personDoctorTel = "暂无"
  }
  // 护士格式化
  if (baseinfo.Nurse && baseinfo.Nurse != "" && baseinfo.Nurse != null) {
    let b = baseinfo.Nurse.split(",")
    b.forEach(item => {
      // 不等于空格时
      if (item != " ") {
        personNurseTel += item + (item != "" ? '<br />' : "")
      }

    })
  } else {
    personNurseTel = "暂无"
  }
  return `
  <div style="margin:5px;width:95%;">
    <div style="display:flex;">
      <div style="font-weight:600;width:50px;text-align:left;">名称：</div>
      <span>${baseinfo.Name}</span>
    </div>
    <div style="display:flex;">
      <div style="font-weight:600;width:50px;text-align:left;">医生：</div>
      <span> ${personDoctorTel}</span>
    </div>
    <div style="display:flex;">
      <div style="font-weight:600;width:50px;text-align:left;">护士：</div>
      <span>${personNurseTel}</span>
    </div>
  </div>
`
}
export {
  hospitalInfoContentcopy,
  venueContentcopy,
  vehicleInfoContentcopy,
  venueMedicalPointContentcopy,
  vehicleInfoContentNotGuarantee
}